Operational Semantics of an Imperative Language in Definite Clauses

نویسنده

  • Jørgen Villadsen
چکیده

We present the “big-step” operational semantics of a small programming language NIL (Natural Imperative Language) in definite clauses, thus building on the fixpoint semantics of logic programs. NIL operates on a state which is just a sequence of counters. As basic statements NIL has incrementation, decrementation and test for null. NIL allows for sequential composition and non-deterministic choice of statements as well as mutually recursive definitions of procedures, which we find support our long-term aim of formalizing and reasoning about specific actions and planning tasks for rational agents. A novelty is the use of the de Bruijn notation instead of names. To our knowledge the operational semantics of an imperative language like NIL have not been given in definite clauses, although it is well-known that it is possible. The ISO Prolog source is available at http://www.ruc.dk/~jv/nil.html Solutions obtained using GNU Prolog, see http://gnu-prolog.inria.fr

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Extended Horn Clauses: The Framework and Some Semantics

The purpose of this paper is twofold: to introduce a new extension of concurrent logic programming languages aiming at handling synchronicity and to present and compare several semantics for it. The extended framework essentially rests on an extension of Horn clauses, including multiple atoms in their heads and a guard construct, as well as a new operator between goals. The semantics discussed ...

متن کامل

Towards Provably Correct Code Generation via Horn Logical Continuation Semantics

Provably correct compilation is an important aspect in development of high assurance software systems. In this paper we explore approaches to provably correct code generation based on programming language semantics, particularly Horn logical semantics, and partial evaluation. We show that the definite clause grammar (DCG) notation can be used for specifying both the syntax and semantics of impe...

متن کامل

Comparative Semantics of Generalized Horn Clauses1

The purpose of this paper is to present and analyze semantically a new extension of concurrent logic programming languages aiming at handling synchronicity. It essentially rests on an extension of Horn clauses, called generalized Horn clauses, and on a new parallel operator between goals. Five semantics are presented and compared. They range in the operational, declarative and denotational type...

متن کامل

T C C F     

We review links between three logic formalisms and three approaches to specifying operational semantics. In particular, we show that specifications written with (small-step and big-step) SOS, abstract machines, and multiset rewriting, are closely related to Horn clauses, binary clauses, and (a subset of) linear logic, respectively. We shall illustrate how binary clauses form a bridge between th...

متن کامل

The or That: Definite and Demonstrative Descriptions in Second Language Acquisition

Since Heubner's (1985) pioneering study, there have been many studies on (mis) use/ non-use of articles by L2 learners from article-less and article languages. The present study investigated how Persian L2 learners of English produce and interpret English definite descriptions and demonstrative descriptions. It was assumed that definite and demonstrative descriptions share the same central sema...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2003